package com.kma.summer2012.client.services.session;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.kma.summer2012.shared.model.UICrumbsRequest;
import com.kma.summer2012.shared.model.UICrumbsToolItem;
import com.kma.summer2012.shared.model.UICrumbsWorkItem;

@RemoteServiceRelativePath("CrumbsSessionService")
public interface CrumbsSessionService extends RemoteService {
    // request
    //work
    //tool
    void setParameterWorkItem(String nameProperty, UICrumbsWorkItem property);

    void setParameterTool(String nameProperty, UICrumbsToolItem property);

    void setParameterRequest(String nameProperty, UICrumbsRequest property);

    void setParameterInteger(String nameProperty, int property);

    UICrumbsWorkItem getParameterWorkItem(String nameParameter);

    UICrumbsRequest getParameterRequest(String nameParameter);

    UICrumbsToolItem getParameterToolItem(String nameParameter);

    int getParameterInteger(String nameParameter);

    /**
     * Utility/Convenience class.
     * Use CrumbsSessionService.App.getInstance() to access static instance of CrumbsSessionServiceAsync
     */
    public static class App {
        private static final CrumbsSessionServiceAsync ourInstance = (CrumbsSessionServiceAsync) GWT.create(CrumbsSessionService.class);

        public static CrumbsSessionServiceAsync getInstance() {
            return ourInstance;
        }
    }
}
